package cn.yj.core.business.controller;

import cn.yj.cgs.dba.entity.School;
import cn.yj.config.annotation.Anonymous;
import cn.yj.config.web.AppBaseController;
import cn.yj.core.business.service.SchoolAddressService;
import cn.yj.entity.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 永健
 * @since 2021-04-20 17:42
 */
@RequestMapping("/school")
@RestController
public class SchoolController extends AppBaseController<School>{

    @Resource
    SchoolAddressService schoolAddressService;

    @GetMapping("/list")
    public R list(String name){
        return success(schoolAddressService.listSchoolName(name));
    }

    @GetMapping("/listMap")
    @Anonymous
    public R listMap(String schoolName){
        return success(schoolAddressService.listSchoolMap(schoolName));
    }
}
